<span jwcid="@MainBorder">

     <span jwcid="popup@AjaxPopup"/>
     
	        <table class="AdminTable" width="90%" style="margin: auto">
	        	<form jwcid="form@Form" delegate="ognl:defaultDelegate">
	        	
	                <tr><th colspan="2">BrainTrain Module Admin</th></tr>
	                <tr><td colspan="2">
	                	<span jwcid="ErrorReporter@ErrorReporter" title="Errors" delegate="ognl:defaultDelegate"/> 
	                </td></tr>
		            <tr>
		                <td width="20%">
		                    <b><label jwcid="@FieldLabel" field="component:moduleNameEdit">Module Name*:</label></b>
		                </td>
		                <td>
	                    	<input jwcid="moduleNameEdit@TextField" disabled="ognl:!isContentCreator() and !(isCmStaff() and module.id == null)" maxlength="255" autocomplete="off" value="ognl:module.nullSafeName.deltaValue" size="40" displayName="Name"/>
		                </td>
		            </tr>
		            
		            <tr>
		                <td>
		                    <b><label jwcid="@FieldLabel" field="component:moduleDescriptionEdit">Description:</label></b>
		                </td>
		                <td>
		                	<input jwcid="moduleDescriptionEdit@TextArea" disabled="ognl:!isContentCreator()" value="ognl:module.nullSafeDescription.deltaValue" cols="40" rows="3" displayName="Description"/>
		                </td>
		            </tr>
	            
                 <tr>
	                <td>
                        <b>First Page:</b>
	                </td>
                    <td>
                        <span jwcid="firstPageExists@If" condition="ognl:module.mainPages.size() > 0">
                            <a jwcid="firstPageLink@DirectLink" listener="listener:firstPageLink">First Page</a>
                        </span>
                        <span jwcid="addFirstPage@If" condition="ognl:module.mainPages.size() == 0 and module.id != null && isContentCreator()">
                            <a jwcid="addPageLink2@DirectLink" listener="listener:addContentLink"><span jwcid="addImage3@Image" border="0" image="asset:addImage"/></a>
                            <a jwcid="addPageLink3@DirectLink" listener="listener:addContentLink">Add First Page</a>
                            
                            <br>
                            
                            <a jwcid="addTestLink@DirectLink" listener="listener:addTestLink"><span jwcid="addImage4@Image" border="0" image="asset:addImage"/></a>
                            <a jwcid="addTestLink2@DirectLink" listener="listener:addTestLink">Add First Test</a>
                        </span>
                        <span jwcid="firstPageElse@If" condition="ognl:module.id == null or (isCmStaff() and !isContentCreator() and module.mainPages.size() == 0)">
                        	None <span jwcid="brandNewModule@If" condition="ognl:module.id == null">(Must save module before starting content)</span>
                        </span>
	                </td>
	            </tr>
	            
	            <tr jwcid="firstPageExists2@If" element="tr" condition="ognl:module.id != null and module.active">
	            	<td><b>All Pages:</b></td>
	            	<td>
	            		<span jwcid="allContentDL@DirectLink" listener="listener:allContent">All Pages (Released)</span>
	            	</td>
	            </tr>
	            <tr jwcid="firstPageExists4@If" element="tr" condition="ognl:module.id != null and module.mainPages.size() > 0">
	            	<td></td>
	            	<td>
	            		<span jwcid="allDeltaContentDL@DirectLink" listener="listener:allDeltaContent">All Pages (Pending Changes)</span>
	            	</td>
	            </tr>
	            
	            <tr jwcid="evalsExists@If" element="tr" condition="ognl:module.evaluations.size() > 0">
	            	<td><b>Evaluations:</b></td>
	            	<td>
	            		<span jwcid="evaluationsServiceLink@ServiceLink" service="evaluationCSVService" parameters="ognl:#{ @org.braintrain.tapestry.services.EvaluationCSVService@MODULE_ID : module.id }">evaluations.csv</span>
                        &nbsp;
                        <a jwcid="evaluationReport@ExternalLink" page="EvaluationReport" parameters="ognl:module.id" target="_blank">Evaluation Report</a>
	            	</td>
	            </tr>
	            
	            <tr jwcid="testAnswersExist@If" element="tr" condition="ognl:module.testAnswersExist">
	            	<td><b>Test Answers:</b></td>
	            	<td>
	            		<span jwcid="testAnswerLogServiceLink@ServiceLink" service="testAnswerLogCSVService" parameters="ognl:#{ @org.braintrain.tapestry.services.TestAnswerLogCSVService@MODULE_ID : module.id }">testAnswerLog.csv</span>
	            		&nbsp;
                        <a jwcid="answerReport@ExternalLink" page="AnswerReport" parameters="ognl:module.id" target="_blank">Answer Report</a>
	            	</td>
	            </tr>
	            
	            <tr>
	                <td>
                        <b>Status:</b>
	                </td>
                    <td>
                        <span jwcid="activeInsert@Insert" value="ognl:module.retired? 'Retired' : module.active? 'Active' : 'Inactive'"/>
	                </td>
	            </tr>
	            
	            <tr>
	                <td>
	                	<b>Page Numbering:</b>
	                </td>
                    <td>
                        <span jwcid="numberingPS@PropertySelection" disabled="ognl:!isContentCreator()" model="ognl:pageNumberingPSModel" value="ognl:module.numbering"/>
	                </td>
	            </tr>
	            
	            <tr>
	                <td>
	                </td>
                    <td>
                    	<span jwcid="skipFinishedChaptersCB@Checkbox" disabled="ognl:!isContentCreator()" value="ognl:module.skipFinishedChapters"/>Option to skip to passed 'Bookmarkable' tests
	                </td>
	            </tr>
                
                
	            <tr>
	                <td>
                        <a jwcid="homePageLink@PageLink" page="Home"><span jwcid="backImage@Image" image="asset:backImage" border="0"/></a>
                        <a jwcid="homePageLink2@PageLink" page="Home">Home</a>
                    </td>
                    <td>
                    	<span jwcid="ifContentCreator@If" condition="ognl:isContentCreator() or (isCmStaff() and module.id == null)">
	                        <input jwcid="saveSubmit@Submit" label="Save" action="listener:saveSubmit"/>
	                        <input jwcid="cancelSubmit@Submit" label="Cancel" action="listener:cancelSubmit"/>
	                    </span>
                    	<span jwcid="hasPages@If" condition="ognl:module.mainPages.size() > 0">
	                    	
	                        <span jwcid="ifCmStaff@If" condition="ognl:isCmStaff()">
	                        	<span jwcid="isNotRetired@If" condition="ognl:!module.retired">
			                		<input jwcid="releaseModule@Submit" action="listener:releaseModule" onClick="ognl:'return confirm(\'Are you sure you want to release this module?\')'" label="Release" />
			                	</span>
			                	<span jwcid="isActive@If" condition="ognl:module.active">
			                		<input jwcid="inactivateModule@Submit" action="listener:inactivateModule" onClick="ognl:'return confirm(\'Are you sure you want to inactivate this module?\\nThe only way to re-activate it is to release the module again.\')'" label="Inactivate" />
			                	</span>
			                	<input jwcid="retireModule@Submit" action="listener:retireModule" onClick="ognl:'return confirm(\'Are you sure you want to ' + (module.retired? 'un-retire' : 'retire') + ' this module?\')'" label="ognl:module.retired? 'Un-Retire' : 'Retire'" />
			                	<!-- input jwcid="syncDeltaModule@Submit" action="listener:syncDeltaWithReleased" onClick="ognl:'return confirm(\'Are you sure you want to remove all the current changes?\')'" label="Remove Pending Changes (WARNING)" / -->
			                </span>
		                </span>
	                </td>
                    
	            </tr>
	           
	            
	            </form>
	            
	            
                <tr>
                    <td colspan="2">
                    
                        <span jwcid="navigationChainContainer@NavigationChainContainer" reorderable="ognl:true" addPages="ognl:contentCreator" moduleId="ognl:module.id"/>
                   
                    </td>
                </tr>
                <tr><td colspan="2" align="center">
                 	<table class="AdminTable" width="400">
                 	<tr>
                 	<th>Type</th>
                 	<th>Released</th>
                 	<th>New/Edited/Moved</th>
                 	<th>Deleted</th>
                 	</tr>
                 	<tr align="center">
                 	<td>Content</td>
                 	<td><span jwcid="releasedContentImage@Image" image="ognl:contentThumbImage"/></td>
                 	<td><span jwcid="editedContentImage@Image" image="ognl:editedContentThumbImage"/></td>
                 	<td><span jwcid="deletedContentImage@Image" image="ognl:deletedContentThumbImage"/></td>
                 	</tr>
                 	<tr align="center">
                 	<td>Test</td>
                 	<td><span jwcid="releasedTestImage@Image" image="ognl:testThumbImage"/></td>
                 	<td><span jwcid="editedTestImage@Image" image="ognl:editedTestThumbImage"/></td>
                 	<td><span jwcid="deletedTestImage@Image" image="ognl:deletedTestThumbImage"/></td>
                 	</tr>
                 	</table>
                </td></tr>
                <tr>
	                <td colspan="2">
                        <a jwcid="homePageLink3@PageLink" page="Home"><span jwcid="backImage2@Image" image="asset:backImage" border="0"/></a>
                        <a jwcid="homePageLink4@PageLink" page="Home">Home</a>
	                </td>
	            </tr>
	        </table>
</span>